{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pixiedust database opened successfully\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "        <div style=\"margin:10px\">\n",
       "            <a href=\"https://github.com/ibm-watson-data-lab/pixiedust\" target=\"_new\">\n",
       "                <img src=\"https://github.com/ibm-watson-data-lab/pixiedust/raw/master/docs/_static/pd_icon32.png\" style=\"float:left;margin-right:10px\"/>\n",
       "            </a>\n",
       "            <span>Pixiedust version 1.1.14</span>\n",
       "        </div>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#SKIP_COMPARE_OUTPUT\n",
    "import pixiedust"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>abbr</th>\n",
       "      <th>medals.bronze</th>\n",
       "      <th>medals.gold</th>\n",
       "      <th>medals.silver</th>\n",
       "      <th>medals.total</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>RUS</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>8</td>\n",
       "      <td>21</td>\n",
       "      <td>Russian Fed.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>USA</td>\n",
       "      <td>10</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>20</td>\n",
       "      <td>United States</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>NLD</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>6</td>\n",
       "      <td>20</td>\n",
       "      <td>Netherlands</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>NOR</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>19</td>\n",
       "      <td>Norway</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>CAN</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>16</td>\n",
       "      <td>Canada</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   abbr  medals.bronze  medals.gold  medals.silver  medals.total  \\\n",
       "65  RUS              7            6              8            21   \n",
       "81  USA             10            6              4            20   \n",
       "54  NLD              8            6              6            20   \n",
       "56  NOR              7            8              4            19   \n",
       "13  CAN              4            4              8            16   \n",
       "\n",
       "             name  \n",
       "65   Russian Fed.  \n",
       "81  United States  \n",
       "54    Netherlands  \n",
       "56         Norway  \n",
       "13         Canada  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from bokeh.sampledata.olympics2014 import data\n",
    "from pandas.io.json import json_normalize\n",
    "\n",
    "df = json_normalize(data['data'])\n",
    "\n",
    "# try:\n",
    "#     from bkcharts.utils import df_from_json\n",
    "# except ImportError:\n",
    "#     from bokeh.charts.utils import df_from_json\n",
    "\n",
    "# # utilize utility to make it easy to get json/dict data converted to a dataframe\n",
    "# df = df_from_json(data)\n",
    "\n",
    "# filter by countries with at least one medal and sort by total medals\n",
    "df = df[df['medals.total'] > 0]\n",
    "df = df.sort_values(\"medals.total\", ascending=False)\n",
    "\n",
    "# show top 5\n",
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "pixiedust": {
     "displayParams": {
      "handlerId": "tableView"
     }
    },
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">.pd_warning{display:none;}</style><div class=\"pd_warning\"><em>Hey, there's something awesome here! To see it, open this notebook outside GitHub, in a viewer like Jupyter</em></div>\n",
       "        <div class=\"pd_save is-viewer-good\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    <div id=\"chartFigure17258691\" class=\"pd_save is-viewer-good\" style=\"overflow-x:auto\">\n",
       "            <style type=\"text/css\" class=\"pd_save\">\n",
       "    .df-table-wrapper .panel-heading {\n",
       "      border-radius: 0;\n",
       "      padding: 0px;\n",
       "    }\n",
       "    .df-table-wrapper .panel-heading:hover {\n",
       "      border-color: #008571;\n",
       "    }\n",
       "    .df-table-wrapper .panel-title a {\n",
       "      background-color: #f9f9fb;\n",
       "      color: #333333;\n",
       "      display: block;\n",
       "      outline: none;\n",
       "      padding: 10px 15px;\n",
       "      text-decoration: none;\n",
       "    }\n",
       "    .df-table-wrapper .panel-title a:hover {\n",
       "      background-color: #337ab7;\n",
       "      border-color: #2e6da4;\n",
       "      color: #ffffff;\n",
       "      display: block;\n",
       "      padding: 10px 15px;\n",
       "      text-decoration: none;\n",
       "    }\n",
       "    .df-table-wrapper {\n",
       "      font-size: small;\n",
       "      font-weight: 300;\n",
       "      letter-spacing: 0.5px;\n",
       "      line-height: normal;\n",
       "      height: inherit;\n",
       "      overflow: auto;\n",
       "    }\n",
       "    .df-table-search {\n",
       "      margin: 0 0 20px 0;\n",
       "    }\n",
       "    .df-table-search-count {\n",
       "      display: inline-block;\n",
       "      margin: 0 0 20px 0;\n",
       "    }\n",
       "    .df-table-container {\n",
       "      max-height: 50vh;\n",
       "      max-width: 100%;\n",
       "      overflow-x: auto;\n",
       "      position: relative;\n",
       "    }\n",
       "    .df-table-wrapper table {\n",
       "      border: 0 none #ffffff;\n",
       "      border-collapse: collapse;\n",
       "      margin: 0;\n",
       "      min-width: 100%;\n",
       "      padding: 0;\n",
       "      table-layout: fixed;\n",
       "      height: inherit;\n",
       "      overflow: auto;\n",
       "    }\n",
       "    .df-table-wrapper tr.hidden {\n",
       "      display: none;\n",
       "    }\n",
       "    .df-table-wrapper tr:nth-child(even) {\n",
       "      background-color: #f9f9fb;\n",
       "    }\n",
       "    .df-table-wrapper tr.even {\n",
       "      background-color: #f9f9fb;\n",
       "    }\n",
       "    .df-table-wrapper tr.odd {\n",
       "      background-color: #ffffff;\n",
       "    }\n",
       "    .df-table-wrapper td + td {\n",
       "      border-left: 1px solid #e0e0e0;\n",
       "    }\n",
       "  \n",
       "    .df-table-wrapper thead,\n",
       "    .fixed-header {\n",
       "      font-weight: 600;\n",
       "    }\n",
       "    .df-table-wrapper tr,\n",
       "    .fixed-row {\n",
       "      border: 0 none #ffffff;\n",
       "      margin: 0;\n",
       "      padding: 0;\n",
       "    }\n",
       "    .df-table-wrapper th,\n",
       "    .df-table-wrapper td,\n",
       "    .fixed-cell {\n",
       "      border: 0 none #ffffff;\n",
       "      margin: 0;\n",
       "      min-width: 50px;\n",
       "      padding: 5px 20px 5px 10px;\n",
       "      text-align: left;\n",
       "      word-wrap: break-word;\n",
       "    }\n",
       "    .df-table-wrapper th {\n",
       "      padding-bottom: 0;\n",
       "      padding-top: 0;\n",
       "    }\n",
       "    .df-table-wrapper th div {\n",
       "      max-height: 1px;\n",
       "      visibility: hidden;\n",
       "    }\n",
       "  \n",
       "    .df-schema-field {\n",
       "      margin-left: 10px;\n",
       "    }\n",
       "  \n",
       "    .fixed-header-container {\n",
       "      overflow: hidden;\n",
       "      position: relative;\n",
       "    }\n",
       "    .fixed-header {\n",
       "      border-bottom: 2px solid #000;\n",
       "      display: table;\n",
       "      position: relative;\n",
       "    }\n",
       "    .fixed-row {\n",
       "      display: table-row;\n",
       "    }\n",
       "    .fixed-cell {\n",
       "      display: table-cell;\n",
       "    }\n",
       "  </style>\n",
       "  \n",
       "  \n",
       "  <div class=\"df-table-wrapper df-table-wrapper-17258691 panel-group pd_save\">\n",
       "    <!-- dataframe schema -->\n",
       "    \n",
       "    <div class=\"panel panel-default\">\n",
       "      <div class=\"panel-heading\">\n",
       "        <h4 class=\"panel-title\" style=\"margin: 0px;\">\n",
       "          <a data-toggle=\"collapse\" href=\"#df-schema-17258691\" data-parent=\"#df-table-wrapper-17258691\">Schema</a>\n",
       "        </h4>\n",
       "      </div>\n",
       "      <div id=\"df-schema-17258691\" class=\"panel-collapse collapse\">\n",
       "        <div class=\"panel-body\" style=\"font-family: monospace;\">\n",
       "          <div class=\"df-schema-fields\">\n",
       "            <div>Field types:</div>\n",
       "            \n",
       "              <div class=\"df-schema-field\"><strong>abbr: </strong> object</div>\n",
       "            \n",
       "              <div class=\"df-schema-field\"><strong>medals.bronze: </strong> int64</div>\n",
       "            \n",
       "              <div class=\"df-schema-field\"><strong>medals.gold: </strong> int64</div>\n",
       "            \n",
       "              <div class=\"df-schema-field\"><strong>medals.silver: </strong> int64</div>\n",
       "            \n",
       "              <div class=\"df-schema-field\"><strong>medals.total: </strong> int64</div>\n",
       "            \n",
       "              <div class=\"df-schema-field\"><strong>name: </strong> object</div>\n",
       "            \n",
       "          </div>\n",
       "        </div>\n",
       "      </div>\n",
       "    </div>\n",
       "    \n",
       "    <!-- dataframe table -->\n",
       "    <div class=\"panel panel-default\">\n",
       "      \n",
       "      <div class=\"panel-heading\">\n",
       "        <h4 class=\"panel-title\" style=\"margin: 0px;\">\n",
       "          <a data-toggle=\"collapse\" href=\"#df-table-17258691\" data-parent=\"#df-table-wrapper-17258691\"> Table</a>\n",
       "        </h4>\n",
       "      </div>\n",
       "      \n",
       "      <div id=\"df-table-17258691\" class=\"panel-collapse collapse in\">\n",
       "        <div class=\"panel-body\">\n",
       "          \n",
       "          <input type=\"text\" class=\"df-table-search form-control input-sm\" placeholder=\"Search table\">\n",
       "          \n",
       "          <div>\n",
       "            \n",
       "            <span class=\"df-table-search-count\">Showing 26 of 26 rows</span>\n",
       "            \n",
       "          </div>\n",
       "          <!-- fixed header for when dataframe table scrolls -->\n",
       "          <div class=\"fixed-header-container\">\n",
       "            <div class=\"fixed-header\">\n",
       "              <div class=\"fixed-row\">\n",
       "                \n",
       "                <div class=\"fixed-cell\">abbr</div>\n",
       "                \n",
       "                <div class=\"fixed-cell\">medals.bronze</div>\n",
       "                \n",
       "                <div class=\"fixed-cell\">medals.gold</div>\n",
       "                \n",
       "                <div class=\"fixed-cell\">medals.silver</div>\n",
       "                \n",
       "                <div class=\"fixed-cell\">medals.total</div>\n",
       "                \n",
       "                <div class=\"fixed-cell\">name</div>\n",
       "                \n",
       "              </div>\n",
       "            </div>\n",
       "          </div>\n",
       "          <div class=\"df-table-container\">\n",
       "            <table class=\"df-table\">\n",
       "              <thead>\n",
       "                <tr>\n",
       "                  \n",
       "                  <th><div>abbr</div></th>\n",
       "                  \n",
       "                  <th><div>medals.bronze</div></th>\n",
       "                  \n",
       "                  <th><div>medals.gold</div></th>\n",
       "                  \n",
       "                  <th><div>medals.silver</div></th>\n",
       "                  \n",
       "                  <th><div>medals.total</div></th>\n",
       "                  \n",
       "                  <th><div>name</div></th>\n",
       "                  \n",
       "                </tr>\n",
       "              </thead>\n",
       "              <tbody>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>RUS</td>\n",
       "                  \n",
       "                  <td>7</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>8</td>\n",
       "                  \n",
       "                  <td>21</td>\n",
       "                  \n",
       "                  <td>Russian Fed.</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>USA</td>\n",
       "                  \n",
       "                  <td>10</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>20</td>\n",
       "                  \n",
       "                  <td>United States</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>NLD</td>\n",
       "                  \n",
       "                  <td>8</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>20</td>\n",
       "                  \n",
       "                  <td>Netherlands</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>NOR</td>\n",
       "                  \n",
       "                  <td>7</td>\n",
       "                  \n",
       "                  <td>8</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>19</td>\n",
       "                  \n",
       "                  <td>Norway</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>CAN</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>8</td>\n",
       "                  \n",
       "                  <td>16</td>\n",
       "                  \n",
       "                  <td>Canada</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>DEU</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>8</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>15</td>\n",
       "                  \n",
       "                  <td>Germany</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>CHE</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>10</td>\n",
       "                  \n",
       "                  <td>Switzerland</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>FRA</td>\n",
       "                  \n",
       "                  <td>5</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>10</td>\n",
       "                  \n",
       "                  <td>France</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>SWE</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>5</td>\n",
       "                  \n",
       "                  <td>9</td>\n",
       "                  \n",
       "                  <td>Sweden</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>AUT</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>9</td>\n",
       "                  \n",
       "                  <td>Austria</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>SVN</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>7</td>\n",
       "                  \n",
       "                  <td>Slovenia</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>JPN</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>7</td>\n",
       "                  \n",
       "                  <td>Japan</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>CHN</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>China</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>CZE</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>Czech Republic</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>ITA</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>Italy</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>BLR</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>5</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>6</td>\n",
       "                  \n",
       "                  <td>Belarus</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>POL</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>Poland</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>KOR</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>4</td>\n",
       "                  \n",
       "                  <td>Korea</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>AUS</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>Australia</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>LVA</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>Latvia</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>FIN</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>3</td>\n",
       "                  \n",
       "                  <td>Finland</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>GBR</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>2</td>\n",
       "                  \n",
       "                  <td>Great Britain</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>SVK</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>Slovakia</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>HRV</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>Croatia</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>UKR</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>Ukraine</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "                <tr>\n",
       "                  \n",
       "                  <td>KAZ</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>0</td>\n",
       "                  \n",
       "                  <td>1</td>\n",
       "                  \n",
       "                  <td>Kazakhstan</td>\n",
       "                  \n",
       "                </tr>\n",
       "                \n",
       "              </tbody>\n",
       "            </table>\n",
       "          </div>\n",
       "        </div>\n",
       "      </div>\n",
       "    </div>\n",
       "  </div>\n",
       "  \n",
       "  <script class=\"pd_save\">\n",
       "    $(function() {\n",
       "      var tableWrapper = $('.df-table-wrapper-17258691');\n",
       "      var fixedHeader = $('.fixed-header', tableWrapper);\n",
       "      var tableContainer = $('.df-table-container', tableWrapper);\n",
       "      var table = $('.df-table', tableContainer);\n",
       "      var rows = $('tbody > tr', table);\n",
       "      var total = 26;\n",
       "  \n",
       "      fixedHeader\n",
       "        .css('width', table.width())\n",
       "        .find('.fixed-cell')\n",
       "        .each(function(i, e) {\n",
       "          $(this).css('width', $('.df-table-wrapper-17258691 th:nth-child(' + (i+1) + ')').css('width'));\n",
       "        });\n",
       "  \n",
       "      tableContainer.scroll(function() {\n",
       "        fixedHeader.css({ left: table.position().left });\n",
       "      });\n",
       "  \n",
       "      rows.on(\"click\", function(e){\n",
       "          var txt = e.delegateTarget.innerText;\n",
       "          var splits = txt.split(\"\\t\");\n",
       "          var len = splits.length;\n",
       "          var hdrs = $(fixedHeader).find(\".fixed-cell\");\n",
       "          // Add all cells in the selected row as a map to be consumed by the target as needed\n",
       "          var payload = {type:\"select\", targetDivId: \"\" };\n",
       "          for (var i = 0; i < len; i++) {\n",
       "            payload[hdrs[i].innerHTML] = splits[i];\n",
       "          }\n",
       "  \n",
       "          //simple selection highlighting, client adds \"selected\" class\n",
       "          $(this).addClass(\"selected\").siblings().removeClass(\"selected\");\n",
       "          $(document).trigger('pd_event', payload);\n",
       "      });\n",
       "  \n",
       "      $('.df-table-search', tableWrapper).keyup(function() {\n",
       "        var val = '^(?=.*\\\\b' + $.trim($(this).val()).split(/\\s+/).join('\\\\b)(?=.*\\\\b') + ').*$';\n",
       "        var reg = RegExp(val, 'i');\n",
       "        var index = 0;\n",
       "        \n",
       "        rows.each(function(i, e) {\n",
       "          if (!reg.test($(this).text().replace(/\\s+/g, ' '))) {\n",
       "            $(this).attr('class', 'hidden');\n",
       "          }\n",
       "          else {\n",
       "            $(this).attr('class', (++index % 2 == 0 ? 'even' : 'odd'));\n",
       "          }\n",
       "        });\n",
       "        $('.df-table-search-count', tableWrapper).html('Showing ' + index + ' of ' + total + ' rows');\n",
       "      });\n",
       "    });\n",
       "  \n",
       "    $(\".df-table-wrapper td:contains('http://')\").each(function(){var tc = this.textContent; $(this).wrapInner(\"<a target='_blank' href='\" + tc + \"'></a>\");});\n",
       "    $(\".df-table-wrapper td:contains('https://')\").each(function(){var tc = this.textContent; $(this).wrapInner(\"<a target='_blank' href='\" + tc + \"'></a>\");});\n",
       "  </script>\n",
       "  \n",
       "        </div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#SKIP_COMPARE_OUTPUT\n",
    "display(df, no_gen_tests='true')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_8fc72221\">\n",
       "            <pd_event_handler pd_source=\"option_btn_8fc72221\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"renderer8fc72221\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" >matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" selected>bokeh</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#renderer8fc72221\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTML8fc72221');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML8fc72221');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution8fc72221\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution8fc72221\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution8fc72221\").length > 0 ){\n",
       "                    $(\"#execution8fc72221\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone8fc72221 != \"undefined\"){\n",
       "                    onDisplayDone8fc72221();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='8fc72221',aggregation='SUM',filter='{}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS8fc72221').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigure8fc72221\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    <script class=\"pd_save\">\n",
       "                    function setChartScript() {\n",
       "                        if (!window.Bokeh) {\n",
       "                            setTimeout(setChartScript, 250)\n",
       "                        } else {\n",
       "                            var d = document.getElementById(\"pd-bkchartdiv-8fc72221\")\n",
       "                            if (d){\n",
       "                                var el = document.createElement('div')\n",
       "                                el.innerHTML = `\n",
       "<script type=\"text/javascript\">\n",
       "    (function() {\n",
       "  var fn = function() {\n",
       "    Bokeh.safely(function() {\n",
       "      (function(root) {\n",
       "        function embed_document(root) {\n",
       "          var docs_json = {\"1d4160c4-fd47-44ad-a961-119dafc15895\":{\"roots\":{\"references\":[{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"counts\",\"l\"],\"data\":{\"counts\":[0,2,1,2,6,1,5,0,1,4,8,4,6,3,1,3,2,1,1,3,2,8,3,4,0,3,0,3,2,5,1,0,1,0,1,0,0,2,4,1,4,2,0,0,1,2,1,1,0,1,2,6,6,8,8,4,7,4,0,0,6,8,7,1,0,0,2,1,4,2,5,2,0,0,1,6,4,10],\"l\":[\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\"],\"x\":[[\"AUS\",\"medals.gold\"],[\"AUS\",\"medals.silver\"],[\"AUS\",\"medals.bronze\"],[\"AUT\",\"medals.gold\"],[\"AUT\",\"medals.silver\"],[\"AUT\",\"medals.bronze\"],[\"BLR\",\"medals.gold\"],[\"BLR\",\"medals.silver\"],[\"BLR\",\"medals.bronze\"],[\"CAN\",\"medals.gold\"],[\"CAN\",\"medals.silver\"],[\"CAN\",\"medals.bronze\"],[\"CHE\",\"medals.gold\"],[\"CHE\",\"medals.silver\"],[\"CHE\",\"medals.bronze\"],[\"CHN\",\"medals.gold\"],[\"CHN\",\"medals.silver\"],[\"CHN\",\"medals.bronze\"],[\"CZE\",\"medals.gold\"],[\"CZE\",\"medals.silver\"],[\"CZE\",\"medals.bronze\"],[\"DEU\",\"medals.gold\"],[\"DEU\",\"medals.silver\"],[\"DEU\",\"medals.bronze\"],[\"FIN\",\"medals.gold\"],[\"FIN\",\"medals.silver\"],[\"FIN\",\"medals.bronze\"],[\"FRA\",\"medals.gold\"],[\"FRA\",\"medals.silver\"],[\"FRA\",\"medals.bronze\"],[\"GBR\",\"medals.gold\"],[\"GBR\",\"medals.silver\"],[\"GBR\",\"medals.bronze\"],[\"HRV\",\"medals.gold\"],[\"HRV\",\"medals.silver\"],[\"HRV\",\"medals.bronze\"],[\"ITA\",\"medals.gold\"],[\"ITA\",\"medals.silver\"],[\"ITA\",\"medals.bronze\"],[\"JPN\",\"medals.gold\"],[\"JPN\",\"medals.silver\"],[\"JPN\",\"medals.bronze\"],[\"KAZ\",\"medals.gold\"],[\"KAZ\",\"medals.silver\"],[\"KAZ\",\"medals.bronze\"],[\"KOR\",\"medals.gold\"],[\"KOR\",\"medals.silver\"],[\"KOR\",\"medals.bronze\"],[\"LVA\",\"medals.gold\"],[\"LVA\",\"medals.silver\"],[\"LVA\",\"medals.bronze\"],[\"NLD\",\"medals.gold\"],[\"NLD\",\"medals.silver\"],[\"NLD\",\"medals.bronze\"],[\"NOR\",\"medals.gold\"],[\"NOR\",\"medals.silver\"],[\"NOR\",\"medals.bronze\"],[\"POL\",\"medals.gold\"],[\"POL\",\"medals.silver\"],[\"POL\",\"medals.bronze\"],[\"RUS\",\"medals.gold\"],[\"RUS\",\"medals.silver\"],[\"RUS\",\"medals.bronze\"],[\"SVK\",\"medals.gold\"],[\"SVK\",\"medals.silver\"],[\"SVK\",\"medals.bronze\"],[\"SVN\",\"medals.gold\"],[\"SVN\",\"medals.silver\"],[\"SVN\",\"medals.bronze\"],[\"SWE\",\"medals.gold\"],[\"SWE\",\"medals.silver\"],[\"SWE\",\"medals.bronze\"],[\"UKR\",\"medals.gold\"],[\"UKR\",\"medals.silver\"],[\"UKR\",\"medals.bronze\"],[\"USA\",\"medals.gold\"],[\"USA\",\"medals.silver\"],[\"USA\",\"medals.bronze\"]]}},\"id\":\"9be65517-b641-427c-a4bd-056f46306870\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"41e3ad3c-98fc-44fd-bfc7-bcb7cd981fb2\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"5a9cf844-1ec6-4c1c-8a47-dccc90602404\",\"type\":\"PanTool\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f9362eec-2214-4243-8314-33e4a1dd3e73\",\"type\":\"CategoricalTicker\"}},\"id\":\"2657ccee-af13-4a78-989f-049aa5f0dbe7\",\"type\":\"Grid\"},{\"attributes\":{\"children\":[{\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"cd515da2-92f1-4841-96c9-95d9915efcec\",\"type\":\"Row\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"1e726e9b-5a19-4949-b2cd-9d24a5b64383\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"9be65517-b641-427c-a4bd-056f46306870\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"51b525ed-55f1-45a1-8097-e2710b1ffc09\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"0e06dfad-de50-464b-8631-50811e2fbe6a\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"16d45df6-e622-4c50-b375-1fdde1548426\",\"type\":\"CDSView\"}},\"id\":\"f7b9c4bc-4a95-4a8d-94c3-868a4abf67ad\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.925},\"x\":{\"field\":\"x\"}},\"id\":\"0e06dfad-de50-464b-8631-50811e2fbe6a\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"04338405-2952-46fb-a8e9-f240d5873115\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis_label\":\"medals.gold,medals.silver,medals.bronze\",\"formatter\":{\"id\":\"df187a7e-1cea-4be8-b451-e0e3e7a97302\",\"type\":\"BasicTickFormatter\"},\"minor_tick_line_color\":{\"value\":null},\"plot\":{\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11bf725d-91a1-4f00-9f26-5783a2c297ef\",\"type\":\"BasicTicker\"}},\"id\":\"4dfaf10e-9201-4fd5-8d31-564ceca99a0f\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"AUS\",\"medals.gold\"],[\"AUS\",\"medals.silver\"],[\"AUS\",\"medals.bronze\"],[\"AUT\",\"medals.gold\"],[\"AUT\",\"medals.silver\"],[\"AUT\",\"medals.bronze\"],[\"BLR\",\"medals.gold\"],[\"BLR\",\"medals.silver\"],[\"BLR\",\"medals.bronze\"],[\"CAN\",\"medals.gold\"],[\"CAN\",\"medals.silver\"],[\"CAN\",\"medals.bronze\"],[\"CHE\",\"medals.gold\"],[\"CHE\",\"medals.silver\"],[\"CHE\",\"medals.bronze\"],[\"CHN\",\"medals.gold\"],[\"CHN\",\"medals.silver\"],[\"CHN\",\"medals.bronze\"],[\"CZE\",\"medals.gold\"],[\"CZE\",\"medals.silver\"],[\"CZE\",\"medals.bronze\"],[\"DEU\",\"medals.gold\"],[\"DEU\",\"medals.silver\"],[\"DEU\",\"medals.bronze\"],[\"FIN\",\"medals.gold\"],[\"FIN\",\"medals.silver\"],[\"FIN\",\"medals.bronze\"],[\"FRA\",\"medals.gold\"],[\"FRA\",\"medals.silver\"],[\"FRA\",\"medals.bronze\"],[\"GBR\",\"medals.gold\"],[\"GBR\",\"medals.silver\"],[\"GBR\",\"medals.bronze\"],[\"HRV\",\"medals.gold\"],[\"HRV\",\"medals.silver\"],[\"HRV\",\"medals.bronze\"],[\"ITA\",\"medals.gold\"],[\"ITA\",\"medals.silver\"],[\"ITA\",\"medals.bronze\"],[\"JPN\",\"medals.gold\"],[\"JPN\",\"medals.silver\"],[\"JPN\",\"medals.bronze\"],[\"KAZ\",\"medals.gold\"],[\"KAZ\",\"medals.silver\"],[\"KAZ\",\"medals.bronze\"],[\"KOR\",\"medals.gold\"],[\"KOR\",\"medals.silver\"],[\"KOR\",\"medals.bronze\"],[\"LVA\",\"medals.gold\"],[\"LVA\",\"medals.silver\"],[\"LVA\",\"medals.bronze\"],[\"NLD\",\"medals.gold\"],[\"NLD\",\"medals.silver\"],[\"NLD\",\"medals.bronze\"],[\"NOR\",\"medals.gold\"],[\"NOR\",\"medals.silver\"],[\"NOR\",\"medals.bronze\"],[\"POL\",\"medals.gold\"],[\"POL\",\"medals.silver\"],[\"POL\",\"medals.bronze\"],[\"RUS\",\"medals.gold\"],[\"RUS\",\"medals.silver\"],[\"RUS\",\"medals.bronze\"],[\"SVK\",\"medals.gold\"],[\"SVK\",\"medals.silver\"],[\"SVK\",\"medals.bronze\"],[\"SVN\",\"medals.gold\"],[\"SVN\",\"medals.silver\"],[\"SVN\",\"medals.bronze\"],[\"SWE\",\"medals.gold\"],[\"SWE\",\"medals.silver\"],[\"SWE\",\"medals.bronze\"],[\"UKR\",\"medals.gold\"],[\"UKR\",\"medals.silver\"],[\"UKR\",\"medals.bronze\"],[\"USA\",\"medals.gold\"],[\"USA\",\"medals.silver\"],[\"USA\",\"medals.bronze\"]],\"range_padding\":0.1},\"id\":\"d9dfee10-a779-4069-8e20-439c5203052f\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"c20e7b9e-5aaa-4719-9f64-fec11e09e73c\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"items\":[{\"id\":\"cbae44b4-b299-4a2f-b149-a20d362b17c3\",\"type\":\"LegendItem\"}],\"location\":\"top_left\",\"plot\":{\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"49c51abf-729f-405b-adbf-f8d88ac0fd82\",\"type\":\"Legend\"},{\"attributes\":{\"children\":[{\"id\":\"cd515da2-92f1-4841-96c9-95d9915efcec\",\"type\":\"Row\"}]},\"id\":\"1e3e84b4-1ffd-4e52-bf17-e93b0186a4e4\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"0773e3d2-b952-4767-bbef-0c88e12a5891\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"42d87582-83c0-426a-80eb-782bc4d26d2a\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"9be65517-b641-427c-a4bd-056f46306870\",\"type\":\"ColumnDataSource\"}},\"id\":\"16d45df6-e622-4c50-b375-1fdde1548426\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"4fcb520e-9c78-454e-b26b-9c4b48b5e7d7\",\"type\":\"BoxAnnotation\"}},\"id\":\"8a89e136-24ae-46ec-a36a-b9057462b839\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"label\":{\"field\":\"l\"},\"renderers\":[{\"id\":\"f7b9c4bc-4a95-4a8d-94c3-868a4abf67ad\",\"type\":\"GlyphRenderer\"}]},\"id\":\"cbae44b4-b299-4a2f-b149-a20d362b17c3\",\"type\":\"LegendItem\"},{\"attributes\":{\"children\":[{\"id\":\"ef0df15a-0232-41e6-86a0-17941cabe063\",\"type\":\"ToolbarBox\"},{\"id\":\"1e3e84b4-1ffd-4e52-bf17-e93b0186a4e4\",\"type\":\"Column\"}]},\"id\":\"8a865844-30e4-4a4c-88b9-5781b5b17b1c\",\"type\":\"Column\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"11bf725d-91a1-4f00-9f26-5783a2c297ef\",\"type\":\"BasicTicker\"}},\"id\":\"c8b7ee50-2c24-4717-89bf-b51a1f5f244b\",\"type\":\"Grid\"},{\"attributes\":{\"sizing_mode\":\"scale_width\",\"toolbar_location\":\"above\",\"tools\":[{\"id\":\"5a9cf844-1ec6-4c1c-8a47-dccc90602404\",\"type\":\"PanTool\"},{\"id\":\"c8388bcd-94ac-4922-9cf8-9085ab14567a\",\"type\":\"WheelZoomTool\"},{\"id\":\"8a89e136-24ae-46ec-a36a-b9057462b839\",\"type\":\"BoxZoomTool\"},{\"id\":\"0773e3d2-b952-4767-bbef-0c88e12a5891\",\"type\":\"SaveTool\"},{\"id\":\"04338405-2952-46fb-a8e9-f240d5873115\",\"type\":\"ResetTool\"},{\"id\":\"47cf4b74-be19-4c7e-baf4-f28802db1879\",\"type\":\"HelpTool\"},{\"id\":\"7f6d9bcb-7991-471e-bf89-e7b9e209282d\",\"type\":\"HoverTool\"}]},\"id\":\"ef0df15a-0232-41e6-86a0-17941cabe063\",\"type\":\"ToolbarBox\"},{\"attributes\":{},\"id\":\"f9362eec-2214-4243-8314-33e4a1dd3e73\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5a9cf844-1ec6-4c1c-8a47-dccc90602404\",\"type\":\"PanTool\"},{\"id\":\"c8388bcd-94ac-4922-9cf8-9085ab14567a\",\"type\":\"WheelZoomTool\"},{\"id\":\"8a89e136-24ae-46ec-a36a-b9057462b839\",\"type\":\"BoxZoomTool\"},{\"id\":\"0773e3d2-b952-4767-bbef-0c88e12a5891\",\"type\":\"SaveTool\"},{\"id\":\"04338405-2952-46fb-a8e9-f240d5873115\",\"type\":\"ResetTool\"},{\"id\":\"47cf4b74-be19-4c7e-baf4-f28802db1879\",\"type\":\"HelpTool\"},{\"id\":\"7f6d9bcb-7991-471e-bf89-e7b9e209282d\",\"type\":\"HoverTool\"}]},\"id\":\"662e339b-6535-4576-b90f-077e3bac6295\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"47cf4b74-be19-4c7e-baf4-f28802db1879\",\"type\":\"HelpTool\"},{\"attributes\":{\"end\":2,\"factors\":[\"medals.gold\",\"medals.silver\",\"medals.bronze\"],\"palette\":[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\"],\"start\":1},\"id\":\"8f636e07-074f-4788-8c19-a2d0c3e145b9\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4fcb520e-9c78-454e-b26b-9c4b48b5e7d7\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"c8388bcd-94ac-4922-9cf8-9085ab14567a\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"abbr\",\"@x\"],[\"medals.gold,medals.silver,medals.bronze\",\"@counts{0.00}\"]]},\"id\":\"7f6d9bcb-7991-471e-bf89-e7b9e209282d\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"11bf725d-91a1-4f00-9f26-5783a2c297ef\",\"type\":\"BasicTicker\"},{\"attributes\":{\"below\":[{\"id\":\"9a1272a4-4465-403a-8a65-8cab8eb346fe\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"4dfaf10e-9201-4fd5-8d31-564ceca99a0f\",\"type\":\"LinearAxis\"}],\"outline_line_color\":{\"value\":null},\"plot_height\":544,\"plot_width\":915,\"renderers\":[{\"id\":\"9a1272a4-4465-403a-8a65-8cab8eb346fe\",\"type\":\"CategoricalAxis\"},{\"id\":\"2657ccee-af13-4a78-989f-049aa5f0dbe7\",\"type\":\"Grid\"},{\"id\":\"4dfaf10e-9201-4fd5-8d31-564ceca99a0f\",\"type\":\"LinearAxis\"},{\"id\":\"c8b7ee50-2c24-4717-89bf-b51a1f5f244b\",\"type\":\"Grid\"},{\"id\":\"4fcb520e-9c78-454e-b26b-9c4b48b5e7d7\",\"type\":\"BoxAnnotation\"},{\"id\":\"49c51abf-729f-405b-adbf-f8d88ac0fd82\",\"type\":\"Legend\"},{\"id\":\"f7b9c4bc-4a95-4a8d-94c3-868a4abf67ad\",\"type\":\"GlyphRenderer\"}],\"title\":null,\"toolbar\":{\"id\":\"662e339b-6535-4576-b90f-077e3bac6295\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"d9dfee10-a779-4069-8e20-439c5203052f\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"41e3ad3c-98fc-44fd-bfc7-bcb7cd981fb2\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"1e726e9b-5a19-4949-b2cd-9d24a5b64383\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"42d87582-83c0-426a-80eb-782bc4d26d2a\",\"type\":\"LinearScale\"}},\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"df187a7e-1cea-4be8-b451-e0e3e7a97302\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis_label\":\"abbr\",\"formatter\":{\"id\":\"c20e7b9e-5aaa-4719-9f64-fec11e09e73c\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":1,\"major_label_text_color\":{\"value\":null},\"major_label_text_font_size\":{\"value\":\"0px\"},\"major_tick_line_color\":{\"value\":null},\"minor_tick_line_color\":{\"value\":null},\"plot\":{\"id\":\"10f01bb4-7cb5-44ea-8b81-aa3c7aae1d1d\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f9362eec-2214-4243-8314-33e4a1dd3e73\",\"type\":\"CategoricalTicker\"}},\"id\":\"9a1272a4-4465-403a-8a65-8cab8eb346fe\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_color\":{\"field\":\"x\",\"transform\":{\"id\":\"8f636e07-074f-4788-8c19-a2d0c3e145b9\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"x\",\"transform\":{\"id\":\"8f636e07-074f-4788-8c19-a2d0c3e145b9\",\"type\":\"CategoricalColorMapper\"}},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.925},\"x\":{\"field\":\"x\"}},\"id\":\"51b525ed-55f1-45a1-8097-e2710b1ffc09\",\"type\":\"VBar\"}],\"root_ids\":[\"8a865844-30e4-4a4c-88b9-5781b5b17b1c\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.9\"}};\n",
       "          var render_items = [{\"docid\":\"1d4160c4-fd47-44ad-a961-119dafc15895\",\"elementid\":\"d8d999c2-74dc-417b-bd8a-616d132ecc4d\",\"modelid\":\"8a865844-30e4-4a4c-88b9-5781b5b17b1c\"}];\n",
       "      \n",
       "          root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "        }\n",
       "      \n",
       "        if (root.Bokeh !== undefined) {\n",
       "          embed_document(root);\n",
       "        } else {\n",
       "          var attempts = 0;\n",
       "          var timer = setInterval(function(root) {\n",
       "            if (root.Bokeh !== undefined) {\n",
       "              embed_document(root);\n",
       "              clearInterval(timer);\n",
       "            }\n",
       "            attempts++;\n",
       "            if (attempts > 100) {\n",
       "              console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "              clearInterval(timer);\n",
       "            }\n",
       "          }, 10, root)\n",
       "        }\n",
       "      })(window);\n",
       "    });\n",
       "  };\n",
       "  if (document.readyState != \"loading\") fn();\n",
       "  else document.addEventListener(\"DOMContentLoaded\", fn);\n",
       "})();\n",
       "\n",
       "<\\/script>`\n",
       "                                var chartscript = el.childNodes[1]\n",
       "                                var s = document.createElement(\"script\")\n",
       "                                s.innerHTML = chartscript.innerHTML\n",
       "                                d.parentNode.insertBefore(s, d)\n",
       "                            }\n",
       "                        }\n",
       "                    }\n",
       "                    if (!window.Bokeh && !window.autoload){\n",
       "                        window.autoload=true;\n",
       "                        \n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = 1;\n",
       "\n",
       "  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  \n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    }\n",
       "    finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        root._bokeh_is_loading--;\n",
       "        if (root._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.9.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i].call(root, root.Bokeh);\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));\n",
       "                    }\n",
       "                    setChartScript()\n",
       "                    </script>\n",
       "                    <div style=\"padding:5px\" id=\"pd-bkchartdiv-8fc72221\">\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"d8d999c2-74dc-417b-bd8a-616d132ecc4d\"></div>\n",
       "</div></div>\n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Bar Chart Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsize8fc72221\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsize8fc72221\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Cluster By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectclusterby8fc72221\" name=\"clusterby\" r=\"t\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"None\" >None</option>\n",
       "                        \n",
       "                            <option value=\"medals.total\" >medals.total</option>\n",
       "                        \n",
       "                            <option value=\"name\" >name</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedtimeseries8fc72221\" r=\"f\" type=\"checkbox\" name=\"timeseries\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedtimeseries8fc72221\">Time Series</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Type:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectcharttype8fc72221\" name=\"charttype\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"grouped\" selected>grouped</option>\n",
       "                        \n",
       "                            <option value=\"stacked\" >stacked</option>\n",
       "                        \n",
       "                            <option value=\"subplots\" >subplots</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlegend8fc72221\" r=\"f\" type=\"checkbox\" name=\"legend\"\n",
       "                                checked>\n",
       "                    <label for=\"optioncheckedlegend8fc72221\">Show legend</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Sort By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectsortby8fc72221\" name=\"sortby\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"Keys ASC\" selected>Keys ASC</option>\n",
       "                        \n",
       "                            <option value=\"Keys DESC\" >Keys DESC</option>\n",
       "                        \n",
       "                            <option value=\"Values ASC\" >Values ASC</option>\n",
       "                        \n",
       "                            <option value=\"Values DESC\" >Values DESC</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "$(\"[id^=optionselect][id$=8fc72221]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).val();\n",
       "    if (thisValue == \"None\"){\n",
       "        thisValue = null\n",
       "    }\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure8fc72221\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    }\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML8fc72221');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution8fc72221\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution8fc72221\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution8fc72221\").length > 0 ){\n",
       "                    $(\"#execution8fc72221\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone8fc72221 != \"undefined\"){\n",
       "                    onDisplayDone8fc72221();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='8fc72221',aggregation='SUM',filter='{}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS8fc72221').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=8fc72221]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure8fc72221\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML8fc72221');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution8fc72221\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution8fc72221\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution8fc72221\").length > 0 ){\n",
       "                    $(\"#execution8fc72221\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone8fc72221 != \"undefined\"){\n",
       "                    onDisplayDone8fc72221();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='8fc72221',aggregation='SUM',filter='{}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS8fc72221').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=8fc72221]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"8fc72221]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigure8fc72221');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML8fc72221');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution8fc72221\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution8fc72221\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution8fc72221\").length > 0 ){\n",
       "                    $(\"#execution8fc72221\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone8fc72221 != \"undefined\"){\n",
       "                    onDisplayDone8fc72221();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='8fc72221',aggregation='SUM',filter='{}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS8fc72221').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"8fc72221]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='8fc72221',aggregation='SUM',filter='{}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_75fa131c\">\n",
       "            <pd_event_handler pd_source=\"option_btn_75fa131c\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"renderer75fa131c\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" >matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" selected>bokeh</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#renderer75fa131c\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTML75fa131c');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML75fa131c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution75fa131c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution75fa131c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution75fa131c\").length > 0 ){\n",
       "                    $(\"#execution75fa131c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone75fa131c != \"undefined\"){\n",
       "                    onDisplayDone75fa131c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='75fa131c',aggregation='SUM',filter='{\\\"regex\\\": \\\"false\\\",\\\"field\\\": \\\"abbr\\\",\\\"case_matter\\\": \\\"true\\\",\\\"value\\\": \\\"USA|CAN\\\",\\\"constraint\\\": \\\"None\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS75fa131c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigure75fa131c\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    <script class=\"pd_save\">\n",
       "                    function setChartScript() {\n",
       "                        if (!window.Bokeh) {\n",
       "                            setTimeout(setChartScript, 250)\n",
       "                        } else {\n",
       "                            var d = document.getElementById(\"pd-bkchartdiv-75fa131c\")\n",
       "                            if (d){\n",
       "                                var el = document.createElement('div')\n",
       "                                el.innerHTML = `\n",
       "<script type=\"text/javascript\">\n",
       "    (function() {\n",
       "  var fn = function() {\n",
       "    Bokeh.safely(function() {\n",
       "      (function(root) {\n",
       "        function embed_document(root) {\n",
       "          var docs_json = {\"7e6b1f15-1791-4168-964e-f18c946ace3a\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"956771a0-bbd0-45f9-84f4-1793ce3d6afc\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"axis_label\":\"abbr\",\"formatter\":{\"id\":\"956771a0-bbd0-45f9-84f4-1793ce3d6afc\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":1,\"major_label_text_color\":{\"value\":null},\"major_label_text_font_size\":{\"value\":\"0px\"},\"major_tick_line_color\":{\"value\":null},\"minor_tick_line_color\":{\"value\":null},\"plot\":{\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f02f1c43-7f1c-4228-a1d1-088214b6de6b\",\"type\":\"CategoricalTicker\"}},\"id\":\"38cd3a86-63dc-45c0-bb22-2fae85c2dd2e\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"f02f1c43-7f1c-4228-a1d1-088214b6de6b\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis_label\":\"medals.gold,medals.silver,medals.bronze\",\"formatter\":{\"id\":\"93e15e01-b69f-479d-b422-a618620e7fa2\",\"type\":\"BasicTickFormatter\"},\"minor_tick_line_color\":{\"value\":null},\"plot\":{\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c0870302-83a4-41ec-96b1-c99a841e0d2e\",\"type\":\"BasicTicker\"}},\"id\":\"574241b1-24c3-4cd2-b023-e66a175ace65\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"fb7a4f67-f6c9-46e8-8150-397a60cd8538\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"693284b6-e234-4032-89e4-cf9bf3358baf\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"source\":{\"id\":\"ec291b13-6826-4c23-a327-522f0bec3731\",\"type\":\"ColumnDataSource\"}},\"id\":\"a2c9b037-1b70-422f-b324-209126214ea5\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7495790a-b216-42aa-a10f-c6ba9d496c85\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"390a502b-6acf-4408-9038-51e04fc86284\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"93e15e01-b69f-479d-b422-a618620e7fa2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"overlay\":{\"id\":\"2b34a3c2-39c4-4849-b8a7-c745969c7741\",\"type\":\"BoxAnnotation\"}},\"id\":\"ec1726bd-2568-41bf-b79a-8b25ea7e4273\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"items\":[{\"id\":\"151ad2a0-b88a-4aa0-abdc-1f5e282c229a\",\"type\":\"LegendItem\"}],\"location\":\"top_left\",\"plot\":{\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"dfccd338-4d09-4ca0-9cef-cdf32e29ed47\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"ec291b13-6826-4c23-a327-522f0bec3731\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"70837faa-be57-4745-8f17-447c6a43b8bf\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"8b47bfd1-345a-4eea-8cd4-3ac15f6d701f\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"a2c9b037-1b70-422f-b324-209126214ea5\",\"type\":\"CDSView\"}},\"id\":\"44b6dc60-441b-4f7f-86e5-235705c0f2c3\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f02f1c43-7f1c-4228-a1d1-088214b6de6b\",\"type\":\"CategoricalTicker\"}},\"id\":\"06ee1597-83e0-4153-a4c4-2c5b4b5962cf\",\"type\":\"Grid\"},{\"attributes\":{\"children\":[{\"id\":\"ff73f3a9-c865-4e8b-ab08-6bacce16e78b\",\"type\":\"ToolbarBox\"},{\"id\":\"d67b301d-3077-44f8-92be-9cce6bc76e64\",\"type\":\"Column\"}]},\"id\":\"76594879-65d2-4d0c-aa04-ca602256e71c\",\"type\":\"Column\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"14079e1b-e98d-421c-94fe-43303984a3a5\",\"type\":\"PanTool\"},{\"id\":\"7495790a-b216-42aa-a10f-c6ba9d496c85\",\"type\":\"WheelZoomTool\"},{\"id\":\"ec1726bd-2568-41bf-b79a-8b25ea7e4273\",\"type\":\"BoxZoomTool\"},{\"id\":\"1e1ecd5e-6f89-4418-b38e-ff8adacc30df\",\"type\":\"SaveTool\"},{\"id\":\"fb7a4f67-f6c9-46e8-8150-397a60cd8538\",\"type\":\"ResetTool\"},{\"id\":\"390a502b-6acf-4408-9038-51e04fc86284\",\"type\":\"HelpTool\"},{\"id\":\"9f94077e-3cd8-4e44-ad80-aa307f98b983\",\"type\":\"HoverTool\"}]},\"id\":\"ce42dbae-a82f-4eda-8fa9-254fbd6ab18d\",\"type\":\"Toolbar\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2b34a3c2-39c4-4849-b8a7-c745969c7741\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_color\":{\"field\":\"x\",\"transform\":{\"id\":\"bbe7b74b-5630-4ed6-9d8f-e35cb4a4e3c1\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"x\",\"transform\":{\"id\":\"bbe7b74b-5630-4ed6-9d8f-e35cb4a4e3c1\",\"type\":\"CategoricalColorMapper\"}},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.925},\"x\":{\"field\":\"x\"}},\"id\":\"70837faa-be57-4745-8f17-447c6a43b8bf\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"1aa3dca2-3271-4b08-9d0d-095f2c410a42\",\"type\":\"LinearScale\"},{\"attributes\":{\"children\":[{\"id\":\"de9dddfc-e02e-486a-bd85-8350076fd2f7\",\"type\":\"Row\"}]},\"id\":\"d67b301d-3077-44f8-92be-9cce6bc76e64\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"1e1ecd5e-6f89-4418-b38e-ff8adacc30df\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.925},\"x\":{\"field\":\"x\"}},\"id\":\"8b47bfd1-345a-4eea-8cd4-3ac15f6d701f\",\"type\":\"VBar\"},{\"attributes\":{\"below\":[{\"id\":\"38cd3a86-63dc-45c0-bb22-2fae85c2dd2e\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"574241b1-24c3-4cd2-b023-e66a175ace65\",\"type\":\"LinearAxis\"}],\"outline_line_color\":{\"value\":null},\"plot_height\":544,\"plot_width\":915,\"renderers\":[{\"id\":\"38cd3a86-63dc-45c0-bb22-2fae85c2dd2e\",\"type\":\"CategoricalAxis\"},{\"id\":\"06ee1597-83e0-4153-a4c4-2c5b4b5962cf\",\"type\":\"Grid\"},{\"id\":\"574241b1-24c3-4cd2-b023-e66a175ace65\",\"type\":\"LinearAxis\"},{\"id\":\"1ff68066-118d-4b95-abee-8abe7eafe3bd\",\"type\":\"Grid\"},{\"id\":\"2b34a3c2-39c4-4849-b8a7-c745969c7741\",\"type\":\"BoxAnnotation\"},{\"id\":\"dfccd338-4d09-4ca0-9cef-cdf32e29ed47\",\"type\":\"Legend\"},{\"id\":\"44b6dc60-441b-4f7f-86e5-235705c0f2c3\",\"type\":\"GlyphRenderer\"}],\"title\":null,\"toolbar\":{\"id\":\"ce42dbae-a82f-4eda-8fa9-254fbd6ab18d\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"871da031-da27-44fc-ba13-ddc8fd11b5a4\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"693284b6-e234-4032-89e4-cf9bf3358baf\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"7b25cc8f-0a68-4aae-98c3-bc1d503d33c1\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1aa3dca2-3271-4b08-9d0d-095f2c410a42\",\"type\":\"LinearScale\"}},\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"14079e1b-e98d-421c-94fe-43303984a3a5\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"abbr\",\"@x\"],[\"medals.gold,medals.silver,medals.bronze\",\"@counts{0.00}\"]]},\"id\":\"9f94077e-3cd8-4e44-ad80-aa307f98b983\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"c0870302-83a4-41ec-96b1-c99a841e0d2e\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"field\":\"l\"},\"renderers\":[{\"id\":\"44b6dc60-441b-4f7f-86e5-235705c0f2c3\",\"type\":\"GlyphRenderer\"}]},\"id\":\"151ad2a0-b88a-4aa0-abdc-1f5e282c229a\",\"type\":\"LegendItem\"},{\"attributes\":{\"children\":[{\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"de9dddfc-e02e-486a-bd85-8350076fd2f7\",\"type\":\"Row\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"180279f8-3e0f-4561-b231-83146b1f2daf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c0870302-83a4-41ec-96b1-c99a841e0d2e\",\"type\":\"BasicTicker\"}},\"id\":\"1ff68066-118d-4b95-abee-8abe7eafe3bd\",\"type\":\"Grid\"},{\"attributes\":{\"sizing_mode\":\"scale_width\",\"toolbar_location\":\"above\",\"tools\":[{\"id\":\"14079e1b-e98d-421c-94fe-43303984a3a5\",\"type\":\"PanTool\"},{\"id\":\"7495790a-b216-42aa-a10f-c6ba9d496c85\",\"type\":\"WheelZoomTool\"},{\"id\":\"ec1726bd-2568-41bf-b79a-8b25ea7e4273\",\"type\":\"BoxZoomTool\"},{\"id\":\"1e1ecd5e-6f89-4418-b38e-ff8adacc30df\",\"type\":\"SaveTool\"},{\"id\":\"fb7a4f67-f6c9-46e8-8150-397a60cd8538\",\"type\":\"ResetTool\"},{\"id\":\"390a502b-6acf-4408-9038-51e04fc86284\",\"type\":\"HelpTool\"},{\"id\":\"9f94077e-3cd8-4e44-ad80-aa307f98b983\",\"type\":\"HoverTool\"}]},\"id\":\"ff73f3a9-c865-4e8b-ab08-6bacce16e78b\",\"type\":\"ToolbarBox\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"CAN\",\"medals.gold\"],[\"CAN\",\"medals.silver\"],[\"CAN\",\"medals.bronze\"],[\"USA\",\"medals.gold\"],[\"USA\",\"medals.silver\"],[\"USA\",\"medals.bronze\"]],\"range_padding\":0.1},\"id\":\"871da031-da27-44fc-ba13-ddc8fd11b5a4\",\"type\":\"FactorRange\"},{\"attributes\":{\"end\":2,\"factors\":[\"medals.gold\",\"medals.silver\",\"medals.bronze\"],\"palette\":[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\"],\"start\":1},\"id\":\"bbe7b74b-5630-4ed6-9d8f-e35cb4a4e3c1\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"counts\",\"l\"],\"data\":{\"counts\":[4,8,4,6,4,10],\"l\":[\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\"],\"x\":[[\"CAN\",\"medals.gold\"],[\"CAN\",\"medals.silver\"],[\"CAN\",\"medals.bronze\"],[\"USA\",\"medals.gold\"],[\"USA\",\"medals.silver\"],[\"USA\",\"medals.bronze\"]]}},\"id\":\"ec291b13-6826-4c23-a327-522f0bec3731\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"7b25cc8f-0a68-4aae-98c3-bc1d503d33c1\",\"type\":\"DataRange1d\"}],\"root_ids\":[\"76594879-65d2-4d0c-aa04-ca602256e71c\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.9\"}};\n",
       "          var render_items = [{\"docid\":\"7e6b1f15-1791-4168-964e-f18c946ace3a\",\"elementid\":\"d9bc53ff-9e4f-4543-be3c-5e86e1aef2be\",\"modelid\":\"76594879-65d2-4d0c-aa04-ca602256e71c\"}];\n",
       "      \n",
       "          root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "        }\n",
       "      \n",
       "        if (root.Bokeh !== undefined) {\n",
       "          embed_document(root);\n",
       "        } else {\n",
       "          var attempts = 0;\n",
       "          var timer = setInterval(function(root) {\n",
       "            if (root.Bokeh !== undefined) {\n",
       "              embed_document(root);\n",
       "              clearInterval(timer);\n",
       "            }\n",
       "            attempts++;\n",
       "            if (attempts > 100) {\n",
       "              console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "              clearInterval(timer);\n",
       "            }\n",
       "          }, 10, root)\n",
       "        }\n",
       "      })(window);\n",
       "    });\n",
       "  };\n",
       "  if (document.readyState != \"loading\") fn();\n",
       "  else document.addEventListener(\"DOMContentLoaded\", fn);\n",
       "})();\n",
       "\n",
       "<\\/script>`\n",
       "                                var chartscript = el.childNodes[1]\n",
       "                                var s = document.createElement(\"script\")\n",
       "                                s.innerHTML = chartscript.innerHTML\n",
       "                                d.parentNode.insertBefore(s, d)\n",
       "                            }\n",
       "                        }\n",
       "                    }\n",
       "                    if (!window.Bokeh && !window.autoload){\n",
       "                        window.autoload=true;\n",
       "                        \n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = 1;\n",
       "\n",
       "  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  \n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    }\n",
       "    finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        root._bokeh_is_loading--;\n",
       "        if (root._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.9.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i].call(root, root.Bokeh);\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));\n",
       "                    }\n",
       "                    setChartScript()\n",
       "                    </script>\n",
       "                    <div style=\"padding:5px\" id=\"pd-bkchartdiv-75fa131c\">\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"d9bc53ff-9e4f-4543-be3c-5e86e1aef2be\"></div>\n",
       "</div></div>\n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Bar Chart Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsize75fa131c\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsize75fa131c\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Cluster By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectclusterby75fa131c\" name=\"clusterby\" r=\"t\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"None\" >None</option>\n",
       "                        \n",
       "                            <option value=\"medals.total\" >medals.total</option>\n",
       "                        \n",
       "                            <option value=\"name\" >name</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedtimeseries75fa131c\" r=\"f\" type=\"checkbox\" name=\"timeseries\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedtimeseries75fa131c\">Time Series</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Type:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectcharttype75fa131c\" name=\"charttype\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"grouped\" selected>grouped</option>\n",
       "                        \n",
       "                            <option value=\"stacked\" >stacked</option>\n",
       "                        \n",
       "                            <option value=\"subplots\" >subplots</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlegend75fa131c\" r=\"f\" type=\"checkbox\" name=\"legend\"\n",
       "                                checked>\n",
       "                    <label for=\"optioncheckedlegend75fa131c\">Show legend</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Sort By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectsortby75fa131c\" name=\"sortby\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"Keys ASC\" selected>Keys ASC</option>\n",
       "                        \n",
       "                            <option value=\"Keys DESC\" >Keys DESC</option>\n",
       "                        \n",
       "                            <option value=\"Values ASC\" >Values ASC</option>\n",
       "                        \n",
       "                            <option value=\"Values DESC\" >Values DESC</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "$(\"[id^=optionselect][id$=75fa131c]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).val();\n",
       "    if (thisValue == \"None\"){\n",
       "        thisValue = null\n",
       "    }\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure75fa131c\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    }\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML75fa131c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution75fa131c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution75fa131c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution75fa131c\").length > 0 ){\n",
       "                    $(\"#execution75fa131c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone75fa131c != \"undefined\"){\n",
       "                    onDisplayDone75fa131c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='75fa131c',aggregation='SUM',filter='{\\\"regex\\\": \\\"false\\\",\\\"field\\\": \\\"abbr\\\",\\\"case_matter\\\": \\\"true\\\",\\\"value\\\": \\\"USA|CAN\\\",\\\"constraint\\\": \\\"None\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS75fa131c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=75fa131c]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure75fa131c\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML75fa131c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution75fa131c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution75fa131c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution75fa131c\").length > 0 ){\n",
       "                    $(\"#execution75fa131c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone75fa131c != \"undefined\"){\n",
       "                    onDisplayDone75fa131c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='75fa131c',aggregation='SUM',filter='{\\\"regex\\\": \\\"false\\\",\\\"field\\\": \\\"abbr\\\",\\\"case_matter\\\": \\\"true\\\",\\\"value\\\": \\\"USA|CAN\\\",\\\"constraint\\\": \\\"None\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS75fa131c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=75fa131c]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"75fa131c]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigure75fa131c');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML75fa131c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution75fa131c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution75fa131c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution75fa131c\").length > 0 ){\n",
       "                    $(\"#execution75fa131c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone75fa131c != \"undefined\"){\n",
       "                    onDisplayDone75fa131c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='75fa131c',aggregation='SUM',filter='{\\\"regex\\\": \\\"false\\\",\\\"field\\\": \\\"abbr\\\",\\\"case_matter\\\": \\\"true\\\",\\\"value\\\": \\\"USA|CAN\\\",\\\"constraint\\\": \\\"None\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS75fa131c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"75fa131c]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# medals count for United States and Canada\n",
    "display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='75fa131c',aggregation='SUM',filter='{\"regex\": \"false\",\"field\": \"abbr\",\"case_matter\": \"true\",\"value\": \"USA|CAN\",\"constraint\": \"None\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_5e14e0e8\">\n",
       "            <pd_event_handler pd_source=\"option_btn_5e14e0e8\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"renderer5e14e0e8\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" >matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" selected>bokeh</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#renderer5e14e0e8\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTML5e14e0e8');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML5e14e0e8');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution5e14e0e8\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution5e14e0e8\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution5e14e0e8\").length > 0 ){\n",
       "                    $(\"#execution5e14e0e8\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone5e14e0e8 != \"undefined\"){\n",
       "                    onDisplayDone5e14e0e8();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='5e14e0e8',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.total\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"19\\\",\\\"constraint\\\": \\\"greater_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS5e14e0e8').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigure5e14e0e8\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    <script class=\"pd_save\">\n",
       "                    function setChartScript() {\n",
       "                        if (!window.Bokeh) {\n",
       "                            setTimeout(setChartScript, 250)\n",
       "                        } else {\n",
       "                            var d = document.getElementById(\"pd-bkchartdiv-5e14e0e8\")\n",
       "                            if (d){\n",
       "                                var el = document.createElement('div')\n",
       "                                el.innerHTML = `\n",
       "<script type=\"text/javascript\">\n",
       "    (function() {\n",
       "  var fn = function() {\n",
       "    Bokeh.safely(function() {\n",
       "      (function(root) {\n",
       "        function embed_document(root) {\n",
       "          var docs_json = {\"ecacdc54-cb6d-418f-9298-f724d09f0b1f\":{\"roots\":{\"references\":[{\"attributes\":{\"axis_label\":\"abbr\",\"formatter\":{\"id\":\"ccca3937-29ca-4d9a-9a90-bdb99ce9e6a0\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":1,\"major_label_text_color\":{\"value\":null},\"major_label_text_font_size\":{\"value\":\"0px\"},\"major_tick_line_color\":{\"value\":null},\"minor_tick_line_color\":{\"value\":null},\"plot\":{\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"114aa2ee-61d1-40d7-a5a8-738f835437de\",\"type\":\"CategoricalTicker\"}},\"id\":\"b884124b-8c3e-4b57-a03d-24dcb5e677b2\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.925},\"x\":{\"field\":\"x\"}},\"id\":\"67f37275-0cdb-4bb7-985f-40fd3b25bf28\",\"type\":\"VBar\"},{\"attributes\":{},\"id\":\"3fe55e76-7cb5-449d-9e98-ca4cdfe6806a\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"114aa2ee-61d1-40d7-a5a8-738f835437de\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"914215ee-3dee-4d2e-8982-8a7b3889e56b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"39ee2205-2f10-4f33-9bfe-395dbbd05782\",\"type\":\"VBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"67f37275-0cdb-4bb7-985f-40fd3b25bf28\",\"type\":\"VBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"141b0fa1-ff80-4190-8086-d3145172ca79\",\"type\":\"CDSView\"}},\"id\":\"58d93c33-ae7c-4b03-9c2d-55835c727bd1\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"c39e2817-dc63-42c8-b5f1-4db102b72784\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis_label\":\"medals.gold,medals.silver,medals.bronze\",\"formatter\":{\"id\":\"b4593c50-2f5d-45b7-b46b-859afa3c22e9\",\"type\":\"BasicTickFormatter\"},\"minor_tick_line_color\":{\"value\":null},\"plot\":{\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7a4fe093-1c4e-469e-802d-3ab47aea7364\",\"type\":\"BasicTicker\"}},\"id\":\"c45a0b32-1ff4-445e-bf7f-0ffc82750144\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"fdbc0f32-2b4b-402f-bf66-6d0926057eb7\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7a4fe093-1c4e-469e-802d-3ab47aea7364\",\"type\":\"BasicTicker\"}},\"id\":\"fdffd36a-fdba-4ff7-80b4-cd3931fb9bc8\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"fdbc0f32-2b4b-402f-bf66-6d0926057eb7\",\"type\":\"BoxAnnotation\"}},\"id\":\"509baec6-f5f5-4648-aeff-75fa896f39f1\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"items\":[{\"id\":\"babdaf74-0d10-483c-80c7-9dd3a0d446a0\",\"type\":\"LegendItem\"}],\"location\":\"top_left\",\"plot\":{\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"bb905380-29a8-4cfd-bbf1-5baad4b7e346\",\"type\":\"Legend\"},{\"attributes\":{\"children\":[{\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"}]},\"id\":\"7af4a5c6-41f0-40d9-9d27-a7b725fb9f28\",\"type\":\"Row\"},{\"attributes\":{\"fill_color\":{\"field\":\"x\",\"transform\":{\"id\":\"c2f147bc-7ea5-4ec9-9542-0174e65913ff\",\"type\":\"CategoricalColorMapper\"}},\"line_color\":{\"field\":\"x\",\"transform\":{\"id\":\"c2f147bc-7ea5-4ec9-9542-0174e65913ff\",\"type\":\"CategoricalColorMapper\"}},\"top\":{\"field\":\"counts\"},\"width\":{\"value\":0.925},\"x\":{\"field\":\"x\"}},\"id\":\"39ee2205-2f10-4f33-9bfe-395dbbd05782\",\"type\":\"VBar\"},{\"attributes\":{\"end\":2,\"factors\":[\"medals.gold\",\"medals.silver\",\"medals.bronze\"],\"palette\":[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\"],\"start\":1},\"id\":\"c2f147bc-7ea5-4ec9-9542-0174e65913ff\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"114aa2ee-61d1-40d7-a5a8-738f835437de\",\"type\":\"CategoricalTicker\"}},\"id\":\"2cd45585-3401-4ad8-9fc3-cc5dcd0d25ac\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"factors\":[[\"NLD\",\"medals.gold\"],[\"NLD\",\"medals.silver\"],[\"NLD\",\"medals.bronze\"],[\"RUS\",\"medals.gold\"],[\"RUS\",\"medals.silver\"],[\"RUS\",\"medals.bronze\"],[\"USA\",\"medals.gold\"],[\"USA\",\"medals.silver\"],[\"USA\",\"medals.bronze\"]],\"range_padding\":0.1},\"id\":\"8debbfd0-bd20-443d-8c78-ee7133642ccb\",\"type\":\"FactorRange\"},{\"attributes\":{\"label\":{\"field\":\"l\"},\"renderers\":[{\"id\":\"58d93c33-ae7c-4b03-9c2d-55835c727bd1\",\"type\":\"GlyphRenderer\"}]},\"id\":\"babdaf74-0d10-483c-80c7-9dd3a0d446a0\",\"type\":\"LegendItem\"},{\"attributes\":{\"children\":[{\"id\":\"a8953b07-2fbd-4495-96f8-3e49c2d01a6a\",\"type\":\"ToolbarBox\"},{\"id\":\"a0952526-42fa-43fc-9d8c-e2a67c3a43f3\",\"type\":\"Column\"}]},\"id\":\"f8a47bbf-c2ff-4818-b052-79d7588baab2\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"60ca3f55-8a4a-406d-a6bb-c07c5a10722a\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"b4593c50-2f5d-45b7-b46b-859afa3c22e9\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"abbr\",\"@x\"],[\"medals.gold,medals.silver,medals.bronze\",\"@counts{0.00}\"]]},\"id\":\"a51e61ce-c555-4629-9092-853641dc246c\",\"type\":\"HoverTool\"},{\"attributes\":{\"source\":{\"id\":\"914215ee-3dee-4d2e-8982-8a7b3889e56b\",\"type\":\"ColumnDataSource\"}},\"id\":\"141b0fa1-ff80-4190-8086-d3145172ca79\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"counts\",\"l\"],\"data\":{\"counts\":[6,6,8,6,8,7,6,4,10],\"l\":[\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\",\"medals.gold\",\"medals.silver\",\"medals.bronze\"],\"x\":[[\"NLD\",\"medals.gold\"],[\"NLD\",\"medals.silver\"],[\"NLD\",\"medals.bronze\"],[\"RUS\",\"medals.gold\"],[\"RUS\",\"medals.silver\"],[\"RUS\",\"medals.bronze\"],[\"USA\",\"medals.gold\"],[\"USA\",\"medals.silver\"],[\"USA\",\"medals.bronze\"]]}},\"id\":\"914215ee-3dee-4d2e-8982-8a7b3889e56b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"start\":0},\"id\":\"818932db-5f57-4340-82aa-5554aaa749bb\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"f40fb6aa-fc36-411e-8318-c13a4f19d644\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4b9c44fa-fd17-4823-83b5-e638bcf46cd1\",\"type\":\"HelpTool\"},{\"attributes\":{\"sizing_mode\":\"scale_width\",\"toolbar_location\":\"above\",\"tools\":[{\"id\":\"3fe55e76-7cb5-449d-9e98-ca4cdfe6806a\",\"type\":\"PanTool\"},{\"id\":\"60ca3f55-8a4a-406d-a6bb-c07c5a10722a\",\"type\":\"WheelZoomTool\"},{\"id\":\"509baec6-f5f5-4648-aeff-75fa896f39f1\",\"type\":\"BoxZoomTool\"},{\"id\":\"f40fb6aa-fc36-411e-8318-c13a4f19d644\",\"type\":\"SaveTool\"},{\"id\":\"c39e2817-dc63-42c8-b5f1-4db102b72784\",\"type\":\"ResetTool\"},{\"id\":\"4b9c44fa-fd17-4823-83b5-e638bcf46cd1\",\"type\":\"HelpTool\"},{\"id\":\"a51e61ce-c555-4629-9092-853641dc246c\",\"type\":\"HoverTool\"}]},\"id\":\"a8953b07-2fbd-4495-96f8-3e49c2d01a6a\",\"type\":\"ToolbarBox\"},{\"attributes\":{\"below\":[{\"id\":\"b884124b-8c3e-4b57-a03d-24dcb5e677b2\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"c45a0b32-1ff4-445e-bf7f-0ffc82750144\",\"type\":\"LinearAxis\"}],\"outline_line_color\":{\"value\":null},\"plot_height\":544,\"plot_width\":915,\"renderers\":[{\"id\":\"b884124b-8c3e-4b57-a03d-24dcb5e677b2\",\"type\":\"CategoricalAxis\"},{\"id\":\"2cd45585-3401-4ad8-9fc3-cc5dcd0d25ac\",\"type\":\"Grid\"},{\"id\":\"c45a0b32-1ff4-445e-bf7f-0ffc82750144\",\"type\":\"LinearAxis\"},{\"id\":\"fdffd36a-fdba-4ff7-80b4-cd3931fb9bc8\",\"type\":\"Grid\"},{\"id\":\"fdbc0f32-2b4b-402f-bf66-6d0926057eb7\",\"type\":\"BoxAnnotation\"},{\"id\":\"bb905380-29a8-4cfd-bbf1-5baad4b7e346\",\"type\":\"Legend\"},{\"id\":\"58d93c33-ae7c-4b03-9c2d-55835c727bd1\",\"type\":\"GlyphRenderer\"}],\"title\":null,\"toolbar\":{\"id\":\"fbc6c52a-9cee-4095-8d61-92e20f4ce1ba\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"8debbfd0-bd20-443d-8c78-ee7133642ccb\",\"type\":\"FactorRange\"},\"x_scale\":{\"id\":\"fa7c5a2b-6c0b-4434-990d-debc36b3f224\",\"type\":\"CategoricalScale\"},\"y_range\":{\"id\":\"818932db-5f57-4340-82aa-5554aaa749bb\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"815d3f84-73ca-4092-b897-b0a7c1203d74\",\"type\":\"LinearScale\"}},\"id\":\"940380cf-ed10-42cd-9d7a-6682988f3089\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"fa7c5a2b-6c0b-4434-990d-debc36b3f224\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"children\":[{\"id\":\"7af4a5c6-41f0-40d9-9d27-a7b725fb9f28\",\"type\":\"Row\"}]},\"id\":\"a0952526-42fa-43fc-9d8c-e2a67c3a43f3\",\"type\":\"Column\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"3fe55e76-7cb5-449d-9e98-ca4cdfe6806a\",\"type\":\"PanTool\"},{\"id\":\"60ca3f55-8a4a-406d-a6bb-c07c5a10722a\",\"type\":\"WheelZoomTool\"},{\"id\":\"509baec6-f5f5-4648-aeff-75fa896f39f1\",\"type\":\"BoxZoomTool\"},{\"id\":\"f40fb6aa-fc36-411e-8318-c13a4f19d644\",\"type\":\"SaveTool\"},{\"id\":\"c39e2817-dc63-42c8-b5f1-4db102b72784\",\"type\":\"ResetTool\"},{\"id\":\"4b9c44fa-fd17-4823-83b5-e638bcf46cd1\",\"type\":\"HelpTool\"},{\"id\":\"a51e61ce-c555-4629-9092-853641dc246c\",\"type\":\"HoverTool\"}]},\"id\":\"fbc6c52a-9cee-4095-8d61-92e20f4ce1ba\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"7a4fe093-1c4e-469e-802d-3ab47aea7364\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"ccca3937-29ca-4d9a-9a90-bdb99ce9e6a0\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"815d3f84-73ca-4092-b897-b0a7c1203d74\",\"type\":\"LinearScale\"}],\"root_ids\":[\"f8a47bbf-c2ff-4818-b052-79d7588baab2\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.9\"}};\n",
       "          var render_items = [{\"docid\":\"ecacdc54-cb6d-418f-9298-f724d09f0b1f\",\"elementid\":\"083b99a7-4b20-4d29-86ec-7432ca7c0510\",\"modelid\":\"f8a47bbf-c2ff-4818-b052-79d7588baab2\"}];\n",
       "      \n",
       "          root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "        }\n",
       "      \n",
       "        if (root.Bokeh !== undefined) {\n",
       "          embed_document(root);\n",
       "        } else {\n",
       "          var attempts = 0;\n",
       "          var timer = setInterval(function(root) {\n",
       "            if (root.Bokeh !== undefined) {\n",
       "              embed_document(root);\n",
       "              clearInterval(timer);\n",
       "            }\n",
       "            attempts++;\n",
       "            if (attempts > 100) {\n",
       "              console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "              clearInterval(timer);\n",
       "            }\n",
       "          }, 10, root)\n",
       "        }\n",
       "      })(window);\n",
       "    });\n",
       "  };\n",
       "  if (document.readyState != \"loading\") fn();\n",
       "  else document.addEventListener(\"DOMContentLoaded\", fn);\n",
       "})();\n",
       "\n",
       "<\\/script>`\n",
       "                                var chartscript = el.childNodes[1]\n",
       "                                var s = document.createElement(\"script\")\n",
       "                                s.innerHTML = chartscript.innerHTML\n",
       "                                d.parentNode.insertBefore(s, d)\n",
       "                            }\n",
       "                        }\n",
       "                    }\n",
       "                    if (!window.Bokeh && !window.autoload){\n",
       "                        window.autoload=true;\n",
       "                        \n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = 1;\n",
       "\n",
       "  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  \n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    }\n",
       "    finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        root._bokeh_is_loading--;\n",
       "        if (root._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.9.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.9.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.9.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i].call(root, root.Bokeh);\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));\n",
       "                    }\n",
       "                    setChartScript()\n",
       "                    </script>\n",
       "                    <div style=\"padding:5px\" id=\"pd-bkchartdiv-5e14e0e8\">\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"083b99a7-4b20-4d29-86ec-7432ca7c0510\"></div>\n",
       "</div></div>\n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Bar Chart Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsize5e14e0e8\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsize5e14e0e8\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Cluster By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectclusterby5e14e0e8\" name=\"clusterby\" r=\"t\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"None\" >None</option>\n",
       "                        \n",
       "                            <option value=\"medals.total\" >medals.total</option>\n",
       "                        \n",
       "                            <option value=\"name\" >name</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedtimeseries5e14e0e8\" r=\"f\" type=\"checkbox\" name=\"timeseries\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedtimeseries5e14e0e8\">Time Series</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Type:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectcharttype5e14e0e8\" name=\"charttype\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"grouped\" selected>grouped</option>\n",
       "                        \n",
       "                            <option value=\"stacked\" >stacked</option>\n",
       "                        \n",
       "                            <option value=\"subplots\" >subplots</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlegend5e14e0e8\" r=\"f\" type=\"checkbox\" name=\"legend\"\n",
       "                                checked>\n",
       "                    <label for=\"optioncheckedlegend5e14e0e8\">Show legend</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Sort By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectsortby5e14e0e8\" name=\"sortby\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"Keys ASC\" selected>Keys ASC</option>\n",
       "                        \n",
       "                            <option value=\"Keys DESC\" >Keys DESC</option>\n",
       "                        \n",
       "                            <option value=\"Values ASC\" >Values ASC</option>\n",
       "                        \n",
       "                            <option value=\"Values DESC\" >Values DESC</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "$(\"[id^=optionselect][id$=5e14e0e8]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).val();\n",
       "    if (thisValue == \"None\"){\n",
       "        thisValue = null\n",
       "    }\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure5e14e0e8\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    }\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML5e14e0e8');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution5e14e0e8\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution5e14e0e8\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution5e14e0e8\").length > 0 ){\n",
       "                    $(\"#execution5e14e0e8\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone5e14e0e8 != \"undefined\"){\n",
       "                    onDisplayDone5e14e0e8();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='5e14e0e8',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.total\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"19\\\",\\\"constraint\\\": \\\"greater_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS5e14e0e8').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=5e14e0e8]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure5e14e0e8\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML5e14e0e8');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution5e14e0e8\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution5e14e0e8\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution5e14e0e8\").length > 0 ){\n",
       "                    $(\"#execution5e14e0e8\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone5e14e0e8 != \"undefined\"){\n",
       "                    onDisplayDone5e14e0e8();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='5e14e0e8',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.total\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"19\\\",\\\"constraint\\\": \\\"greater_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS5e14e0e8').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=5e14e0e8]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"5e14e0e8]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigure5e14e0e8');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML5e14e0e8');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution5e14e0e8\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution5e14e0e8\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution5e14e0e8\").length > 0 ){\n",
       "                    $(\"#execution5e14e0e8\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone5e14e0e8 != \"undefined\"){\n",
       "                    onDisplayDone5e14e0e8();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='5e14e0e8',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.total\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"19\\\",\\\"constraint\\\": \\\"greater_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS5e14e0e8').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"5e14e0e8]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# medals count for countries with more than 19 total medals\n",
    "display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='5e14e0e8',aggregation='SUM',filter='{\"regex\": \"False\",\"field\": \"medals.total\",\"case_matter\": \"False\",\"value\": \"19\",\"constraint\": \"greater_than\"}',rowCount='100',nostore_vh='1098',valueFields='medals.gold,medals.silver,medals.bronze',rendererId='bokeh',keyFields='abbr',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_11fa0564\">\n",
       "            <pd_event_handler pd_source=\"option_btn_11fa0564\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"renderer11fa0564\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" selected>matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" >bokeh</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#renderer11fa0564\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTML11fa0564');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML11fa0564');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution11fa0564\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution11fa0564\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution11fa0564\").length > 0 ){\n",
       "                    $(\"#execution11fa0564\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone11fa0564 != \"undefined\"){\n",
       "                    onDisplayDone11fa0564();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_pixiedust='true',showLegend='true',no_margin='true',handlerId='barChart',aggregation='SUM',filter='{}',rowCount='100',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',nostore_cw='1098',nostore_vh='1098',org_params='gen_tests,nostore_pixiedust',nostore_bokeh='true',prefix='11fa0564')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS11fa0564').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigure11fa0564\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    \n",
       "                            <center><img style=\"max-width:initial !important\" src=\"\"  class=\"pd_save\"></center>\n",
       "                        \n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Bar Chart Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsize11fa0564\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsize11fa0564\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Cluster By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectclusterby11fa0564\" name=\"clusterby\" r=\"t\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"None\" >None</option>\n",
       "                        \n",
       "                            <option value=\"medals.bronze\" >medals.bronze</option>\n",
       "                        \n",
       "                            <option value=\"medals.gold\" >medals.gold</option>\n",
       "                        \n",
       "                            <option value=\"medals.silver\" >medals.silver</option>\n",
       "                        \n",
       "                            <option value=\"name\" >name</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedtimeseries11fa0564\" r=\"f\" type=\"checkbox\" name=\"timeseries\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedtimeseries11fa0564\">Time Series</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Orientation:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectorientation11fa0564\" name=\"orientation\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"vertical\" selected>vertical</option>\n",
       "                        \n",
       "                            <option value=\"horizontal\" >horizontal</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlegend11fa0564\" r=\"f\" type=\"checkbox\" name=\"legend\"\n",
       "                                checked>\n",
       "                    <label for=\"optioncheckedlegend11fa0564\">Show legend</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Sort By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectsortby11fa0564\" name=\"sortby\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"Keys ASC\" selected>Keys ASC</option>\n",
       "                        \n",
       "                            <option value=\"Keys DESC\" >Keys DESC</option>\n",
       "                        \n",
       "                            <option value=\"Values ASC\" >Values ASC</option>\n",
       "                        \n",
       "                            <option value=\"Values DESC\" selected>Values DESC</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedmpld311fa0564\" r=\"t\" type=\"checkbox\" name=\"mpld3\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedmpld311fa0564\">D3 Rendering (mpld3)</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "$(\"[id^=optionselect][id$=11fa0564]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).val();\n",
       "    if (thisValue == \"None\"){\n",
       "        thisValue = null\n",
       "    }\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure11fa0564\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    }\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML11fa0564');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution11fa0564\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution11fa0564\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution11fa0564\").length > 0 ){\n",
       "                    $(\"#execution11fa0564\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone11fa0564 != \"undefined\"){\n",
       "                    onDisplayDone11fa0564();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_pixiedust='true',showLegend='true',no_margin='true',handlerId='barChart',aggregation='SUM',filter='{}',rowCount='100',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',nostore_cw='1098',nostore_vh='1098',org_params='gen_tests,nostore_pixiedust',nostore_bokeh='true',prefix='11fa0564')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS11fa0564').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=11fa0564]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigure11fa0564\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML11fa0564');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution11fa0564\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution11fa0564\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution11fa0564\").length > 0 ){\n",
       "                    $(\"#execution11fa0564\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone11fa0564 != \"undefined\"){\n",
       "                    onDisplayDone11fa0564();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_pixiedust='true',showLegend='true',no_margin='true',handlerId='barChart',aggregation='SUM',filter='{}',rowCount='100',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',nostore_cw='1098',nostore_vh='1098',org_params='gen_tests,nostore_pixiedust',nostore_bokeh='true',prefix='11fa0564')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS11fa0564').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=11fa0564]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"11fa0564]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigure11fa0564');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTML11fa0564');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#execution11fa0564\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#execution11fa0564\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#execution11fa0564\").length > 0 ){\n",
       "                    $(\"#execution11fa0564\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDone11fa0564 != \"undefined\"){\n",
       "                    onDisplayDone11fa0564();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_pixiedust='true',showLegend='true',no_margin='true',handlerId='barChart',aggregation='SUM',filter='{}',rowCount='100',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',nostore_cw='1098',nostore_vh='1098',org_params='gen_tests,nostore_pixiedust',nostore_bokeh='true',prefix='11fa0564')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJS11fa0564').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"11fa0564]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(df,cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_pixiedust='true',showLegend='true',no_margin='true',handlerId='barChart',aggregation='SUM',filter='{}',rowCount='100',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',nostore_cw='1098',nostore_vh='1098',org_params='gen_tests,nostore_pixiedust',nostore_bokeh='true',prefix='11fa0564')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "<div class=\"row chart-button-group\">\n",
       "    <div class=\"form-group col-sm-9\" style=\"padding-right:10px;\">\n",
       "        \n",
       "        <button pd_app=\"pixiedust.display.chart.options.defaultOptions.DefaultOptions\" \n",
       "            class=\"btn btn-default no_loading_msg\"\n",
       "            pd_options=\"runInDialog=true\"\n",
       "            id=\"option_btn_adf92c2c\">\n",
       "            <pd_event_handler pd_source=\"option_btn_adf92c2c\" pd_script=\"ShellAccess[eventInfo['entity']].on_ok()\"></pd_event_handler>\n",
       "            Options\n",
       "        </button>\n",
       "        \n",
       "        \n",
       "        \n",
       "        <button pd_app=\"pixiedust.apps.gateway.share.ShareChartApp\" \n",
       "                pd_options=\"runInDialog=true;title=Share Chart\" \n",
       "                class=\"btn btn-default no_loading_msg\">\n",
       "            Share\n",
       "        </button>\n",
       "    </div>\n",
       "    \n",
       "    <div class=\"form-group col-sm-3\">\n",
       "        \n",
       "        <label class=\"field\">Renderer:</label>\n",
       "        <select class=\"form-control\" id=\"rendereradf92c2c\" style=\"margin:0; display:inline-block; width:70%;\">\n",
       "            \n",
       "                <option value=\"matplotlib\" selected>matplotlib</option>\n",
       "            \n",
       "                <option value=\"bokeh\" >bokeh</option>\n",
       "            \n",
       "        </select>\n",
       "        \n",
       "    </div>\n",
       "    \n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "\n",
       "$(\"#rendereradf92c2c\").change(function(){\n",
       "    var rendererId = $(this).val();\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'wrapperHTMLadf92c2c');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLadf92c2c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionadf92c2c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionadf92c2c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionadf92c2c\").length > 0 ){\n",
       "                    $(\"#executionadf92c2c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDoneadf92c2c != \"undefined\"){\n",
       "                    onDisplayDoneadf92c2c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='adf92c2c',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.gold\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"1\\\",\\\"constraint\\\": \\\"less_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        addOptions({\"rendererId\": rendererId });\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSadf92c2c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()\n",
       "});\n",
       "</script>\n",
       "\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\">\n",
       "        <div class=\"pd_save\" style=\"padding-right:10px;text-align: center;line-height:initial !important;font-size: xx-large;font-weight: 500;color: coral;\">\n",
       "            \n",
       "        </div>\n",
       "    </div>\n",
       "</div>\n",
       "<div class=\"row\">\n",
       "    <div class=\"form-group col-sm-10\" style=\"padding-right:10px;\">\n",
       "        <div id=\"chartFigureadf92c2c\" class=\"pd_save\" style=\"overflow-x:auto\">\n",
       "            \n",
       "                    \n",
       "                            <center><img style=\"max-width:initial !important\" src=\"\"  class=\"pd_save\"></center>\n",
       "                        \n",
       "                    \n",
       "                \n",
       "        </div>\n",
       "    </div>\n",
       "    <div class=\"form-group col-sm-2 rendererOpts\">\n",
       "        \n",
       "        <div><strong>Bar Chart Options</strong></div>\n",
       "        \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Chart Size: <span id=\"slidevalchartsizeadf92c2c\">100</span></label>\n",
       "                    \n",
       "                    <div id=\"sliderchartsizeadf92c2c\"\n",
       "                        name=\"chartsize\"\n",
       "                        data-min=50\n",
       "                        data-max=100\n",
       "                        data-default=100\n",
       "                        style=\"margin: 0 0.6em;\"></div>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Cluster By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectclusterbyadf92c2c\" name=\"clusterby\" r=\"t\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"None\" >None</option>\n",
       "                        \n",
       "                            <option value=\"medals.bronze\" >medals.bronze</option>\n",
       "                        \n",
       "                            <option value=\"medals.gold\" >medals.gold</option>\n",
       "                        \n",
       "                            <option value=\"medals.silver\" >medals.silver</option>\n",
       "                        \n",
       "                            <option value=\"name\" >name</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedtimeseriesadf92c2c\" r=\"f\" type=\"checkbox\" name=\"timeseries\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedtimeseriesadf92c2c\">Time Series</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Orientation:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectorientationadf92c2c\" name=\"orientation\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"vertical\" selected>vertical</option>\n",
       "                        \n",
       "                            <option value=\"horizontal\" >horizontal</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedlegendadf92c2c\" r=\"f\" type=\"checkbox\" name=\"legend\"\n",
       "                                checked>\n",
       "                    <label for=\"optioncheckedlegendadf92c2c\">Show legend</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt\">\n",
       "                    <label class=\"field\">Sort By:</label>\n",
       "                    \n",
       "                    <select class=\"form-control\" id=\"optionselectsortbyadf92c2c\" name=\"sortby\" r=\"f\" style=\"margin-left: 0px;\">\n",
       "                        \n",
       "                            <option value=\"Keys ASC\" selected>Keys ASC</option>\n",
       "                        \n",
       "                            <option value=\"Keys DESC\" >Keys DESC</option>\n",
       "                        \n",
       "                            <option value=\"Values ASC\" >Values ASC</option>\n",
       "                        \n",
       "                            <option value=\"Values DESC\" selected>Values DESC</option>\n",
       "                        \n",
       "                    </select>\n",
       "                </div>\n",
       "            \n",
       "            \n",
       "            \n",
       "        \n",
       "            \n",
       "            \n",
       "            \n",
       "            \n",
       "                <div class=\"rendererOpt checkbox checkbox-primary\">\n",
       "                    <input id=\"optioncheckedmpld3adf92c2c\" r=\"t\" type=\"checkbox\" name=\"mpld3\"\n",
       "                                >\n",
       "                    <label for=\"optioncheckedmpld3adf92c2c\">D3 Rendering (mpld3)</label>\n",
       "                    \n",
       "                </div>\n",
       "            \n",
       "            \n",
       "        \n",
       "        \n",
       "    </div>\n",
       "</div>\n",
       "\n",
       "<script>\n",
       "\n",
       "$(\"[id^=optionselect][id$=adf92c2c]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).val();\n",
       "    if (thisValue == \"None\"){\n",
       "        thisValue = null\n",
       "    }\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigureadf92c2c\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    }\n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLadf92c2c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionadf92c2c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionadf92c2c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionadf92c2c\").length > 0 ){\n",
       "                    $(\"#executionadf92c2c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDoneadf92c2c != \"undefined\"){\n",
       "                    onDisplayDoneadf92c2c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='adf92c2c',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.gold\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"1\\\",\\\"constraint\\\": \\\"less_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSadf92c2c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=optionchecked][id$=adf92c2c]\").change(function(){\n",
       "    var thisOption = $(this).attr('name');\n",
       "    var thisValue = $(this).prop('checked').toString();\n",
       "    var refresh = $(this).attr('r')\n",
       "    var $divId = \"chartFigureadf92c2c\"\n",
       "    if (refresh == \"t\"){\n",
       "        $divId = null\n",
       "    } \n",
       "    \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + $divId);\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLadf92c2c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionadf92c2c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionadf92c2c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionadf92c2c\").length > 0 ){\n",
       "                    $(\"#executionadf92c2c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDoneadf92c2c != \"undefined\"){\n",
       "                    onDisplayDoneadf92c2c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='adf92c2c',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.gold\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"1\\\",\\\"constraint\\\": \\\"less_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "        var o = {};\n",
       "        o[thisOption] = thisValue;\n",
       "        if (refresh != \"t\"){\n",
       "            o[\"nostore_figureOnly\"] = \"true\";\n",
       "        }\n",
       "        addOptions(o);\n",
       "    \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSadf92c2c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "});\n",
       "\n",
       "\n",
       "$(\"[id^=slider][id$=adf92c2c]\").each(function() {\n",
       "    var sliderElt = $(this)\n",
       "    var thisOption = sliderElt.attr('name')\n",
       "    var min = sliderElt.data(\"min\")\n",
       "    var max = sliderElt.data(\"max\")\n",
       "    var val = sliderElt.data(\"default\")\n",
       "    sliderElt.slider({\n",
       "        min: isNaN(min) ? 0 : min,\n",
       "        max: isNaN(max) ? 100 : max,\n",
       "        value: isNaN(val) ? 50 : val,\n",
       "        change: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"adf92c2c]\").text(ui.value);\n",
       "            \n",
       "        \n",
       "    \n",
       "    !\n",
       "function() {\n",
       "    function getTargetNode(){\n",
       "        var n = $('#' + 'chartFigureadf92c2c');\n",
       "        if (n.length == 0 ){\n",
       "            n = $('#wrapperHTMLadf92c2c');\n",
       "        }\n",
       "        return n;\n",
       "    }\n",
       "    cellId = typeof cellId === \"undefined\" ? \"\" : cellId;\n",
       "    var curCell=IPython.notebook.get_cells().filter(function(cell){\n",
       "        return cell.cell_id==\"AC4F51AFEF57444C9CCBD551F0C6C2D8\".replace(\"cellId\",cellId);\n",
       "    });\n",
       "    curCell=curCell.length>0?curCell[0]:null;\n",
       "    console.log(\"curCell\",curCell);\n",
       "    var startWallToWall;\n",
       "    //Resend the display command\n",
       "    var callbacks = {\n",
       "        shell : {\n",
       "            payload : {\n",
       "                set_next_input : function(payload){\n",
       "                    if (curCell){\n",
       "                        curCell._handle_set_next_input(payload);\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        iopub:{\n",
       "            output:function(msg){\n",
       "                console.log(\"msg\", msg);\n",
       "                if (false){\n",
       "                    //curCell.output_area.clear_output(false, true);\n",
       "                    curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                    return;\n",
       "                }\n",
       "                var msg_type=msg.header.msg_type;\n",
       "                var content = msg.content;\n",
       "                var executionTime = $(\"#executionadf92c2c\");\n",
       "                if(msg_type===\"stream\"){\n",
       "                    getTargetNode().html(content.text);\n",
       "                }else if (msg_type===\"display_data\" || msg_type===\"execute_result\"){\n",
       "                    var html=null;\n",
       "                    if (!!content.data[\"text/html\"]){\n",
       "                        html=content.data[\"text/html\"];\n",
       "                    }else if (!!content.data[\"image/png\"]){\n",
       "                        html=html||\"\";\n",
       "                        html+=\"<img src='data:image/png;base64,\" +content.data[\"image/png\"]+\"'></img>\";\n",
       "                    }\n",
       "                                                    \n",
       "                    if (!!content.data[\"application/javascript\"]){\n",
       "                        try {\n",
       "                            eval(content.data[\"application/javascript\"]);\n",
       "                        } catch(err) {\n",
       "                            curCell.output_area.handle_output.apply(curCell.output_area, arguments);\n",
       "                        }                        \n",
       "                        return;\n",
       "                    }\n",
       "                    \n",
       "                    if (html){\n",
       "                        if (pixiedust){\n",
       "                            if (callbacks.options && callbacks.options.nostore_delaysave){\n",
       "                                setTimeout(function(){\n",
       "                                    pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                                }, 1000);\n",
       "                            }else{\n",
       "                                pixiedust.saveOutputInCell(curCell, content, html, msg_type);\n",
       "                            }                         \n",
       "                        }\n",
       "\n",
       "                        try{\n",
       "                            getTargetNode().html(html);\n",
       "                        }catch(e){\n",
       "                            console.log(\"Invalid html output\", e, html);\n",
       "                            getTargetNode().html( \"Invalid html output: \" + e.message + \"<pre>\" \n",
       "                                + html.replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;') + \"<pre>\");\n",
       "                        }\n",
       "                    }\n",
       "                }else if (msg_type === \"error\") {\n",
       "                    require(['base/js/utils'], function(utils) {\n",
       "                        var tb = content.traceback;\n",
       "                        console.log(\"tb\",tb);\n",
       "                        if (tb && tb.length>0){\n",
       "                            var data = tb.reduce(function(res, frame){return res+frame+'\\\\n';},\"\");\n",
       "                            console.log(\"data\",data);\n",
       "                            data = utils.fixConsole(data);\n",
       "                            data = utils.fixCarriageReturn(data);\n",
       "                            data = utils.autoLinkUrls(data);\n",
       "                            getTargetNode().html(\"<pre>\" + data +\"</pre>\");\n",
       "                        }\n",
       "                    });\n",
       "                }\n",
       "\n",
       "                //Append profiling info\n",
       "                if (executionTime.length > 0 && $(\"#executionadf92c2c\").length == 0 ){\n",
       "                    getTargetNode().append(executionTime);\n",
       "                }else if (startWallToWall && $(\"#executionadf92c2c\").length > 0 ){\n",
       "                    $(\"#executionadf92c2c\").append($(\"<div/>\").text(\"Wall to Wall time: \" + ( (new Date().getTime() - startWallToWall)/1000 ) + \"s\"));\n",
       "                }\n",
       "\n",
       "                if (typeof onDisplayDoneadf92c2c != \"undefined\"){\n",
       "                    onDisplayDoneadf92c2c();\n",
       "                }\n",
       "                $(document).trigger('pd_event', {type:\"pd_load\", targetNode: getTargetNode()});\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "    \n",
       "    if (IPython && IPython.notebook && IPython.notebook.session && IPython.notebook.session.kernel){\n",
       "        var command = \"display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='adf92c2c',aggregation='SUM',filter='{\\\"regex\\\": \\\"False\\\",\\\"field\\\": \\\"medals.gold\\\",\\\"case_matter\\\": \\\"False\\\",\\\"value\\\": \\\"1\\\",\\\"constraint\\\": \\\"less_than\\\"}',rowCount='100',nostore_vh='1098',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')\".replace(\"cellId\",cellId);\n",
       "        function addOptions(options, override=true){\n",
       "            function getStringRep(v) {\n",
       "                return \"'\" + v + \"'\";\n",
       "            }\n",
       "            for (var key in (options||{})){\n",
       "                var value = options[key];\n",
       "                var hasValue = value != null && typeof value !== 'undefined' && value !== '';\n",
       "                var replaceValue = hasValue ? (key+\"=\" + getStringRep(value) ) : \"\";\n",
       "                var pattern = (hasValue?\"\":\",\")+\"\\\\s*\" + key + \"\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "                var rpattern=new RegExp(pattern);\n",
       "                var n = command.search(rpattern);\n",
       "                if ( n >= 0 ){\n",
       "                    if (override){\n",
       "                        command = command.replace(rpattern, replaceValue);\n",
       "                    }\n",
       "                }else if (hasValue){\n",
       "                    var n = command.lastIndexOf(\")\");\n",
       "                    command = [command.slice(0, n), (command[n-1]==\"(\"? \"\":\",\") + replaceValue, command.slice(n)].join('')\n",
       "                }        \n",
       "            }\n",
       "        }\n",
       "        if(typeof cellMetadata != \"undefined\" && cellMetadata.displayParams){\n",
       "            addOptions(cellMetadata.displayParams);\n",
       "        }else if (curCell && curCell._metadata.pixiedust ){\n",
       "            addOptions(curCell._metadata.pixiedust.displayParams || {}, ('True'=='True') );\n",
       "        }\n",
       "        addOptions({});\n",
       "        \n",
       "        \n",
       "        \n",
       "                var o = {};\n",
       "                o[thisOption] = ui.value;\n",
       "                o[\"nostore_figureOnly\"] = \"true\";\n",
       "                addOptions(o);\n",
       "            \n",
       "    \n",
       "        \n",
       "        var pattern = \"\\\\w*\\\\s*=\\\\s*'(\\\\\\\\'|[^'])*'\";\n",
       "        var rpattern=new RegExp(pattern,\"g\");\n",
       "        var n = command.match(rpattern);\n",
       "        \n",
       "        var org_params = {}\n",
       "        callbacks.options = callbacks.options || {};\n",
       "        for (var i=0; i<n.length;i++){\n",
       "            var parts = n[i].split(\"=\")\n",
       "            callbacks.options[parts[0].trim()] = parts[1].trim();\n",
       "            if (parts[0].trim() == \"org_params\"){\n",
       "                var value = parts[1].trim()\n",
       "                var values = value.substring(1,value.length-1).split(\",\");\n",
       "                for (var p in values){\n",
       "                    org_params[values[p].trim()] = true;\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "        var displayParams={}\n",
       "        for (var i = 0; i < n.length; i++){\n",
       "            var parts=n[i].split(\"=\");\n",
       "            var key = parts[0].trim();\n",
       "            var value = parts[1].trim()\n",
       "            if (!key.startsWith(\"nostore_\") && key != \"showchrome\" && key != \"prefix\" && key != \"cell_id\" && key != \"org_params\" && !!!org_params[key]){\n",
       "                displayParams[key] = value.substring(1,value.length-1);\n",
       "            }\n",
       "        }\n",
       "        if(curCell&&curCell.output_area){\n",
       "            curCell._metadata.pixiedust = curCell._metadata.pixiedust || {}\n",
       "            curCell._metadata.pixiedust.displayParams=displayParams\n",
       "            curCell.output_area.outputs=[];\n",
       "            var old_msg_id = curCell.last_msg_id;\n",
       "            if (old_msg_id) {\n",
       "                curCell.kernel.clear_callbacks_for_msg(old_msg_id);\n",
       "            }\n",
       "        }else{\n",
       "            console.log(\"couldn't find the cell\");\n",
       "        }\n",
       "        \n",
       "        $('#wrapperJSadf92c2c').html(\"\")\n",
       "        getTargetNode().html('<div style=\"width:100px;height:60px;left:47%;position:relative\"><i class=\"fa fa-circle-o-notch fa-spin\" style=\"font-size:48px\"></i></div>'+\n",
       "        '<div style=\"text-align:center\">Loading your data. Please wait...</div>');\n",
       "        startWallToWall = new Date().getTime();\n",
       "        \n",
       "        console.log(\"Running command2\",command);\n",
       "        IPython.notebook.session.kernel.execute(command, callbacks, {silent:true,store_history:false,stop_on_error:true});\n",
       "    }\n",
       "}\n",
       "()    \n",
       "        },\n",
       "        slide: function(evt, ui) {\n",
       "            $(\"[id=slideval\" + thisOption + \"adf92c2c]\").text(ui.value)\n",
       "        }\n",
       "    });\n",
       "})\n",
       "\n",
       "$(document).ready(function(){ $('[data-toggle=\"pd-tooltip\"]').tooltip(); });\n",
       "</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# countries with most medals but no gold medals\n",
    "display(df,showLegend='true',no_margin='true',handlerId='barChart',org_params='gen_tests,nostore_pixiedust',prefix='adf92c2c',aggregation='SUM',filter='{\"regex\": \"False\",\"field\": \"medals.gold\",\"case_matter\": \"False\",\"value\": \"1\",\"constraint\": \"less_than\"}',rowCount='100',nostore_vh='1098',valueFields='medals.total',rendererId='matplotlib',keyFields='abbr',sortby='Values DESC',cell_id='AC4F51AFEF57444C9CCBD551F0C6C2D8',nostore_bokeh='true',nostore_pixiedust='true')"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "celltoolbar": "Edit Metadata",
  "kernelspec": {
   "display_name": "Python (Spark 2.2.1)",
   "language": "python",
   "name": "py-spark221"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
